<?php
/**
 * Klasse für Rollen
 */
class Model_Role extends Zend_Db_Table_Abstract
{
    /** Table name */
    protected $_name = 'role';
	/** Primary Key */
    protected $_primary = 'rid';
    /**
     * @desc Role of Client
     * @var int
     */
    const ROLE_CLIENT = 1;
    /**
     * @desc Role of Developer
     * @var int
     */
    const ROLE_DEVELOPER = 2;
    /**
     * @desc Role of Developer
     * @var int
     */
    const ROLE_MANAGER = 3;
    /**
     * @desc Role of Developer
     * @var int
     */
    const ROLE_ADMIN = 4;

	public function getAll($where = null, $order = null, $count = null, $offset = null)
	{
		return $this->fetchAll($where, $order, $count, $offset);
	}
    
	public function getRoleByID($rid) {
    	
    	$role = $this->find($rid)->toArray();
		return count($role) == 1 ? $role[0] : false;
    	
    }
	
};

?>